<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui" >
	<p:dialog id="addMoldDlgID" header="新增模具" widgetVar="addMoldDlg" modal="true" resizable="false" >
		<p:outputPanel id="addMoldPanel" style="width: 100%" >
						<table>
							<tr><td>
								<h:outputLabel for="addMoldSeries" value="模具系列："/>
							</td><td>
								<h:outputText id="addMoldSeries" value="#{moldManageAction.addMold.moldSeries.seriesName}"  styleClass="outputInfoFont" style="color: RED"/>
							</td></tr>
							<tr style="height: 5px"></tr>
							<tr><td>
								<h:outputLabel for="addMoldName" value="模具名称："/>
							</td><td >
			    				<h:selectOneMenu id="addMoldName" value="#{moldManageAction.addMold.moldName}" style="width: 170px;font-weight: bold">  
			    				 	<f:selectItem itemLabel="请选择"  itemValue=""/>
					                <f:selectItems value="#{moldManageAction.moldNameItems}"/>
					                <p:ajax event="change" listener="#{moldManageAction.addMoldChangeNumber}"   update=":form:addMoldNumber"/>
					            </h:selectOneMenu>
							</td><td >
								<h:outputLabel for="addMoldState" value="模具状态："/>
							</td><td >
								<h:selectOneMenu id="addMoldState" value="#{moldManageAction.addMold.moldState}" style="width: 170px;font-weight: bold">  
			    				 	<f:selectItem itemLabel="请选择"  itemValue=""/>
					                <f:selectItems value="#{moldManageAction.moldStateItems}"/>
					            </h:selectOneMenu>
							</td></tr>
							<tr style="height: 5px"></tr>
							<tr><td >
								<h:outputLabel for="addMoldThickness" value="模具壁厚："/>
							</td><td>
								<p:spinner id="addMoldThickness"    value="#{moldManageAction.addMold.moldThickness}" min="0.00" stepFactor="0.01" size="13" maxlength="10"
                                        onfocus="replaceComma(id,value);" onkeyup="checkMoneyOnKeyUp(this.id, this.value, 20, 2)" >
					    		     <f:convertNumber type="number" pattern="#,###.##" minFractionDigits="2"/>
					    	    </p:spinner>
							</td><td>
								<h:outputLabel for="addMoldPerWeight" value="模具支重："/>
							</td><td>
								<p:spinner id="addMoldPerWeight"    value="#{moldManageAction.addMold.moldPerWeight}" min="0.00" stepFactor="0.01" size="13" maxlength="10"
								       onfocus="replaceComma(id,value);" onkeyup="checkMoneyOnKeyUp(this.id, this.value, 20, 2)" >
					    		     <f:convertNumber type="number" pattern="#,###.##" minFractionDigits="2"/>
					    	    </p:spinner>
							</td></tr>
							<tr style="height: 5px"></tr>
							<tr><td>
								<h:outputLabel for="addMoldNumber" value="模具型号："/>
							</td><td>
	    						<p:inputText id="addMoldNumber" value="#{moldManageAction.addMold.moldNumber}" size="15" maxlength="10"/>
							</td><td>
								<h:outputLabel for="addMoldSpecification" value="模具规格："/>
							</td><td>
	    						<p:inputText id="addMoldSpecification" value="#{moldManageAction.addMold.moldSpecification}" size="15" maxlength="10"/>
							</td></tr>
							<tr style="height: 5px"></tr>
							<tr><td>
								<h:outputLabel for="addMoldFactory" value="模具厂："/>
							</td><td>
	    						<p:inputText id="addMoldFactory" value="#{moldManageAction.addMold.factoryName}" size="15" maxlength="100"/>
							</td><td>
								<h:outputLabel for="addMoldCreateDate" value="开模日期："/>
							</td><td>
	    						<p:calendar id="addMoldCreateDate" value="#{moldManageAction.addMold.createDate}" size="15"
	    							timeZone="GMT+8" pattern="yyyy-MM-dd" showButtonPanel="true" navigator="true"/>
							</td></tr>
							<tr style="height: 5px"></tr>
							<tr><td>
								<h:outputLabel for="addMoldRemark" value="备注："/>
							</td><td colspan="3">
								<p:inputTextarea id="addMoldRemark" value="#{moldManageAction.addMold.moldRemark}" rows="1" autoResize="false" maxlength="300" style="width:430px"/>
							</td></tr>
						</table>
		</p:outputPanel>
		<f:facet name="footer">
			<p:commandButton value="保存" action="#{moldManageAction.saveMold}" oncomplete="onSaveMoldComplete(xhr, status, args)"
				update=":form:moldTable"/>
		</f:facet>
	</p:dialog>
	
	<!-- 修改模具对话框  -->
	<p:dialog id="updateMoldDlgID" header="修改模具" widgetVar="updateMoldDlg" modal="true" resizable="false" >
		<p:outputPanel id="updateMoldPanel" style="width: 100%" >
						<table>
							<tr><td>
								<h:outputLabel for="updateMoldSeries" value="模具系列："/>
							</td><td >
						    <p:inputText value="#{moldManageAction.updateMold.moldSeries.seriesName}" id="updateMoldSeries" readonly="true" style="width: 160px;font-weight: bold" />
						    <p:commandLink  value="选择" action="#{moldManageAction.doChangeMoldSeries()}" 
							style="color:RED"
							oncomplete="selectMoldSeriesDlg.show();"
							update=":form:moldSeriesTable">
							</p:commandLink>
							</td><td>
								<h:outputLabel for="updateMoldNumber" value="模具型号："/>
							</td><td>
							    <p:inputText id="updateMoldNumber" value="#{moldManageAction.updateMold.moldNumber}" size="15" maxlength="100"/>
							</td></tr>
							<tr><td>
								<h:outputLabel for="updateMoldName" value="模具名称："/>
							</td><td >
			    				<h:selectOneMenu id="updateMoldName" value="#{moldManageAction.updateMold.moldName}" style="width: 170px;font-weight: bold">  
			    				 	<f:selectItem itemLabel="请选择"  itemValue=""/>
					                <f:selectItems value="#{moldManageAction.moldNameItems}"/>
					                <p:ajax event="change" listener="#{moldManageAction.updateMoldChangeNumber}"   update=":form:updateMoldNumber"/>
					            </h:selectOneMenu>
							</td><td>
								<h:outputLabel for="updateMoldSpecification" value="模具规格："/>
							</td><td>
	    						<p:inputText id="updateMoldSpecification" value="#{moldManageAction.updateMold.moldSpecification}" size="15" maxlength="10"/>
							</td></tr>
							<tr style="height: 5px"></tr>
							<tr><td >
								<h:outputLabel for="updateMoldThickness" value="模具壁厚："/>
							</td><td>
								<p:spinner id="updateMoldThickness"    value="#{moldManageAction.updateMold.moldThickness}" min="0.00" stepFactor="0.01" size="13" maxlength="10"
								        onfocus="replaceComma(id,value);" onkeyup="checkMoneyOnKeyUp(this.id, this.value, 20, 2)" >
					    		     <f:convertNumber type="number" pattern="#,###.##" minFractionDigits="2"/>
					    	    </p:spinner>
							</td><td>
								<h:outputLabel for="updateMoldPerWeight" value="模具支重："/>
							</td><td>
								<p:spinner id="updateMoldPerWeight"    value="#{moldManageAction.updateMold.moldPerWeight}" min="0.00" stepFactor="0.01" size="13" maxlength="10"
								        onfocus="replaceComma(id,value);" onkeyup="checkMoneyOnKeyUp(this.id, this.value, 20, 2)" >
					    		     <f:convertNumber type="number" pattern="#,###.##" minFractionDigits="2"/>
					    	    </p:spinner>
							</td></tr>
							<tr style="height: 5px"></tr>
							<tr><td>
								<h:outputLabel for="updateMoldFactory" value="模具厂："/>
							</td><td>
	    						<p:inputText id="updateMoldFactory" value="#{moldManageAction.updateMold.factoryName}" size="15" maxlength="100"/>
							</td><td>
								<h:outputLabel for="updateMoldCreateDate" value="开模日期："/>
							</td><td>
	    						<p:calendar id="updateMoldCreateDate" value="#{moldManageAction.updateMold.createDate}" size="15"
	    							timeZone="GMT+8" pattern="yyyy-MM-dd" showButtonPanel="true" navigator="true"/>
							</td></tr>
							<tr style="height: 5px"></tr>
							<tr><td>
								<h:outputLabel for="updateMoldRemark" value="备注："/>
							</td><td colspan="3">
								<p:inputTextarea id="updateMoldRemark" value="#{moldManageAction.updateMold.moldRemark}" rows="2" autoResize="false" maxlength="300" style="width:430px"/>
							</td></tr>
						</table>
		</p:outputPanel>
		<f:facet name="footer">
			<p:commandButton value="更新" action="#{moldManageAction.doUpdateMold}" oncomplete="onUpdateMoldComplete(xhr, status, args)"
				update=":form:moldTable"/>
		</f:facet>
	</p:dialog>
	
	<p:dialog id="selectMoldseriesDlgID" header="选择模具系列" widgetVar="selectMoldSeriesDlg" modal="true"  resizable="false">
		<h:panelGrid  columns="2" cellpadding="5">
			<p:dataTable id="moldSeriesTable" value="#{moldManageAction.moldSeriesList}" var="moldSeries" rowKey="#{moldSeries}" emptyMessage="没有记录！"
					selection="#{moldManageAction.selectedMoldSeries}"
				    paginator="true" rows="10"  	rowsPerPageTemplate="5,10,15"	paginatorAlwaysVisible="true" 	paginatorPosition="bottom" currentPageReportTemplate="{currentPage} / {totalPages}"
		                paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  >
		        <p:column selectionMode="single" ></p:column>
			    <p:column headerText="系列名称">#{moldSeries.seriesName}</p:column>
			    <p:column headerText="系列代码">#{moldSeries.seriesCode}</p:column>
			    <p:column headerText="系列描述">#{moldSeries.seriesRemark}</p:column>
			</p:dataTable>
			   <f:facet name="footer">
			    <p:commandButton value="确定" action="#{moldManageAction.doChangeMoldSeries}" oncomplete="selectMoldSeriesDlg.hide()"
			    	update=":form:updateMoldSeries,:form:updateMoldNumber"/>
			   </f:facet>
		</h:panelGrid>
	</p:dialog>
				
	<p:dialog id="viewMoldDlgID" header="查看模具" widgetVar="viewMoldDlg" modal="true" resizable="false" >
		<p:outputPanel id="viewMoldPanel" style="width: 100%" >
						<table>
							<tr><td>
								<h:outputLabel for="viewMoldSeries" value="模具系列："/>
							</td><td>
	    						<h:outputText id="viewMoldSeries" value="#{moldManageAction.viewMold.moldSeries.seriesName}"   styleClass="outputInfoFont"/>
							</td><td>
							<h:outputLabel for="viewMoldMachine" value="领用机台："/>
							</td><td>
	    						<h:outputText id="viewMoldMachine" rendered="#{moldManageAction.viewMold.moldState eq 'MoldState_producing'}" value="#{moldManageAction.viewMold.machine.machineNumber}"   styleClass="outputInfoFont"/>
							</td></tr>
							<tr><td>
								<h:outputLabel for="viewMoldName" value="模具名称："/>
							</td><td >
			    				<h:selectOneMenu id="viewMoldName" value="#{moldManageAction.viewMold.moldName}" style="font-weight: bold" disabled="true">  
			    				 	<f:selectItem itemLabel="请选择"  itemValue=""/>
					                <f:selectItems value="#{moldManageAction.moldNameItems}"/>
					            </h:selectOneMenu>
							</td><td >
								<h:outputLabel for="viewMoldState" value="模具状态："/>
							</td><td >
								<h:selectOneMenu id="viewMoldState" value="#{moldManageAction.viewMold.moldState}" style="font-weight: bold" disabled="true">  
			    				 	<f:selectItem itemLabel="请选择"  itemValue=""/>
					                <f:selectItems value="#{moldManageAction.moldStateItems}"/>
					            </h:selectOneMenu>
							</td></tr>
							<tr style="height: 5px"></tr>
							<tr><td >
								<h:outputLabel for="viewMoldThickness" value="模具壁厚："/>
							</td><td>
								<h:outputText id="viewMoldThickness"    value="#{moldManageAction.viewMold.moldThickness}"   styleClass="outputInfoFont"/>
							</td><td>
								<h:outputLabel for="viewMoldPerWeight" value="模具支重："/>
							</td><td>
								<h:outputText id="viewMoldPerWeight"    value="#{moldManageAction.viewMold.moldPerWeight}"   styleClass="outputInfoFont"/>
							</td></tr>
							<tr style="height: 5px"></tr>
							<tr><td>
								<h:outputLabel for="viewMoldNumber" value="模具型号："/>
							</td><td>
	    						<h:outputText id="viewMoldNumber" value="#{moldManageAction.viewMold.moldNumber}"   styleClass="outputInfoFont"/>
							</td><td>
								<h:outputLabel for="viewMoldSpecification" value="模具规格："/>
							</td><td>
	    						<h:outputText id="viewMoldSpecification" value="#{moldManageAction.viewMold.moldSpecification}"   styleClass="outputInfoFont"/>
							</td></tr>
							<tr style="height: 5px"></tr>
							<tr><td>
								<h:outputLabel for="viewMoldFactory" value="模具厂："/>
							</td><td>
	    						<h:outputText id="viewMoldFactory" value="#{moldManageAction.viewMold.factoryName}"   styleClass="outputInfoFont"/>
							</td><td>
								<h:outputLabel for="viewMoldCreateDate" value="开模日期："/>
							</td><td>
	    						<h:outputText id="viewMoldCreateDate" value="#{moldManageAction.viewMold.createDate}"   styleClass="outputInfoFont">
	    							<f:convertDateTime pattern="yyyy年MM月dd日" timeZone="GMT+8" />
	    						</h:outputText>
							</td></tr>
							<tr style="height: 5px"></tr>
							<tr><td>
								<h:outputLabel for="viewMoldLastusedDate" value="最近使用日期："/>
							</td><td>
	    						<h:outputText id="viewMoldLastusedDate" value="#{moldManageAction.viewMold.lastUsedDate}"   styleClass="outputInfoFont">
	    							<f:convertDateTime pattern="yyyy年MM月dd日" timeZone="GMT+8" />
	    						</h:outputText>
							</td><td>
								<h:outputLabel for="viewMoldTotalYield" value="累积产量："/>
							</td><td>
	    						<h:outputText id="viewMoldTotalYield" value="#{moldManageAction.viewMold.totalYield}"   styleClass="outputInfoFont"/>
							</td></tr>
							<tr style="height: 5px"></tr>
							<tr><td>
								<h:outputLabel for="viewMoldIfRework" value="是否返修："/>
							</td><td>
	    						<h:selectOneMenu id="viewMoldIfRework" value="#{moldManageAction.viewMold.ifRework}" style="font-weight: bold" disabled="true">  
			    				 	<f:selectItem itemLabel=""  itemValue=""/>
					                <f:selectItems value="#{moldManageAction.yesOrNoItems}"/>
					            </h:selectOneMenu>
							</td><td>
								<h:outputLabel for="viewMoldDepotDate" value="返修日期："/>
							</td><td>
	    						<h:outputText id="viewMoldDepotDate" value="#{moldManageAction.viewMold.depotDate}"   styleClass="outputInfoFont">
	    							<f:convertDateTime pattern="yyyy年MM月dd日" timeZone="GMT+8"/>
	    						</h:outputText>
							</td></tr>
							<tr style="height: 5px"></tr>
							<tr><td>
								<h:outputLabel for="viewMoldRemark" value="备注："/>
							</td><td colspan="3">
								<p:inputTextarea id="viewMoldRemark" value="#{moldManageAction.viewMold.moldRemark}" rows="2" autoResize="false" 
										maxlength="300" style="width:430px" disabled="true"/>
							</td></tr>
						</table>
		</p:outputPanel>
		<f:facet name="footer">
			<p:commandButton value="确定" oncomplete="viewMoldDlg.hide()"/>
		</f:facet>
	</p:dialog>
</ui:composition>